
stra = input("请随便输入一行字符串：")

y,k,s,t=0,0,0,0
for i in range(0,len(stra)):
    if stra[i].isalpha():
        y+=1
    elif stra[i].isspace():
        k+=1
    elif stra[i].isdigit():
        s+=1
    else:
        t+=1

print("该行字符串\n英文字母：{}个\n空格：{}个\n数字：{}个\n其他字符：{}个".format(y,k,s,t))